package fi.profecons.csswindows.toolkit;

import fi.profecons.csswindows.Element;

public class Textarea extends Element {

	public String value = new String();

	private boolean enabled = true;

	public Textarea() {
		super();
		addCommand("new Textarea('" + getId() + "');");
		if (!isEnabled()) {
			addCommand("getElement('" + getId() + "').disable();");
		}
	}

	public String getValue() {
		return value;
	}

	public void disable() {
		enabled = false;
		addCommand("getElement('" + getId() + "').disable();");
	}

	public void enable() {
		enabled = true;
		addCommand("getElement('" + getId() + "').enable();");
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setValue(String value) {
		this.value = value;
		addCommand("getElement('" + getId() + "').setValue('" + value + "');");
	}

	public void appendValue(String value) {
		this.value = this.value + value;
		addCommand("getElement('" + getId() + "').appendValue('" + value
				+ "');");
	}

}
